import java.util.Scanner;

public class CalculatorTest {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        Calculator ca=new Calculator();
        ca.color="粉色";
        ca.price=76;
        ca.brand="LV";
        ca.idea();
        boolean flag=false;
        do {
            System.out.println("1.加法运算\t2.减法运算\t3.乘法运算\t4.除法运算\t5.立方\t0.退出");
            System.out.println("请选择：");
            int choice=sc.nextInt();
            if (choice==1){
                System.out.println("加法运算，请输入数字：");
                double a=sc.nextDouble();
                double b=sc.nextDouble();
                ca.add(a,b);
                System.out.println("结果为"+ca.add(a,b));
                flag=true;
            }else if (choice==2){
                System.out.println("减法运算，请输入数字");
                double e=sc.nextDouble();
                double f=sc.nextDouble();
                ca.reduce(e,f);
                System.out.println("结果为"+ca.reduce(e,f));
                flag=true;
            }else if (choice==3){
                System.out.println("乘法运算，请输入数字：");
                double c=sc.nextDouble();
                double d=sc.nextDouble();
                ca.by(c,d);
                System.out.println("结果为"+ca.by(c,d));
                flag=true;
            }else if(choice==4){
                System.out.println("除法运算，请输入数字：");
                double i=sc.nextDouble();
                double j=sc.nextDouble();
                ca.divide(i,j);
                System.out.println("结果为"+ca.divide(i,j));
                flag=true;
            }else if(choice==5){
                System.out.println("数的立方，请输入数字：");
                double k=sc.nextDouble();
                ca.cube(k);
                System.out.println("结果为"+ca.cube(k));
                flag=true;
            }else if (choice==0){
                System.out.println("结束使用");
                break;
            }else {
                System.out.println("无此选择项！！！");
                flag=true;
            }
        }while (flag=true);

    }
}
